package testview.zhen.com.myapplication

import android.graphics.Bitmap
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.webkit.WebSettings.LOAD_NO_CACHE
import android.webkit.*
import testview.zhen.com.myapplication.view.LollipopFixedWebView


class WebViewActivity : AppCompatActivity() {

    lateinit var webView: LollipopFixedWebView
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_web_view)
        webView = findViewById(R.id.web)
        val webSettings =  webView.settings
        webSettings.javaScriptEnabled = true
        webSettings.useWideViewPort = true
        webSettings.cacheMode = LOAD_NO_CACHE
        webSettings.loadWithOverviewMode = true
        webView.webViewClient = object :WebViewClient(){
            override fun doUpdateVisitedHistory(view: WebView?, url: String?, isReload: Boolean) {
                super.doUpdateVisitedHistory(view, url, isReload)
            }

            override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
                return super.shouldOverrideUrlLoading(view, request)
            }
        }

        webView.loadUrl("https://www.esmap.cn/sdk-demo/demo")
    }


}
